﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EditSchedule.aspx.cs" Inherits="cs499.Schedule.EditSchedule" %>
<%@ MasterType VirtualPath="~/Site.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="NavOptions" runat="server">
    <asp:Button ID="OKButton" runat="server" Height="33px" Text="Save" UseSubmitBehavior="False" Width="137px" OnClick="OKButton_Click" />
    <asp:Button ID="CancelButton" runat="server" Text="Cancel" Width="133px" PostBackUrl="~/Schedule/Scheduledefault.aspx" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="FeaturedContent" runat="server">
    <section class="featured">
        <div class="content-wrapper">
            <h3><asp:Label ID="EditScheduleLabel" runat="server" Text=""></asp:Label></h3>
        </div>
    </section>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Table ID="AddPrefTable" runat="server" GridLines="Both" Height="78px" Width="559px">
        <asp:TableRow ID="TableRow1" runat="server" Height="20px" VerticalAlign="Middle">
            <asp:TableCell ID="TableCell1" runat="server" Width="25px">
                <asp:Label ID="Label1" runat="server" Text="Taught By"></asp:Label></asp:TableCell>
            <asp:TableCell ID="TableCell2" runat="server">
                <asp:Label ID="Label2" runat="server" Text="Room Number"></asp:Label></asp:TableCell>
            <asp:TableCell ID="TableCell3" runat="server">
                <asp:Label ID="Label3" runat="server" Text="Time Slot"></asp:Label></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow ID="TableRow2" runat="server" Height="30px" VerticalAlign="Top">
            <asp:TableCell ID="TableCell6" runat="server" Width="50px">
                <asp:DropDownList ID="FacultyDropList" runat="server" DataSourceID="FacultyDataSource" Width="148px" DataTextField="UserName" DataValueField="Id" AutoPostBack="True" OnDataBound="FacultyDropList_OnDataBound">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="FacultyDataSource" runat="server" SelectMethod="GetFacultyForDepartment" TypeName="cs499.Database.Faculty">
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="-1" Name="departmentid" SessionField="CurrentDepartmentId" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </asp:TableCell>
            <asp:TableCell ID="TableCell7" runat="server">
                <asp:DropDownList ID="RoomDropList" runat="server" DataSourceID="RoomDataSource" DataTextField="PlaceName" DataValueField="Id" Width="149px" AutoPostBack="True" OnDataBound="RoomDropList_DataBound">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="RoomDataSource" runat="server" SelectMethod="GetAvailableRooms" TypeName="cs499.Database.Schedule">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="-1" Name="courseid" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </asp:TableCell>
            <asp:TableCell ID="TableCell8" runat="server">
                <asp:DropDownList ID="TimeSlotDropList" runat="server" DataSourceID="TimeSlotDataSource" DataValueField="Id" Height="19px" Width="228px" DataTextField="strvalue" OnDataBound="TimeSlotDropList_DataBound">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="TimeSlotDataSource" runat="server" SelectMethod="GetAvailableTimeSlots" TypeName="cs499.Database.Schedule" >
                    <SelectParameters>
                        <asp:ControlParameter ControlID="RoomDropList" DefaultValue="-1" Name="roomid" PropertyName="SelectedValue" Type="Int32" />
                        <asp:ControlParameter ControlID="FacultyDropList" DefaultValue="-1" Name="facultyid" PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
</asp:Content>
